#include "DoublyLinkedList.h"

void test1() {
    ListNode* list = ListCreate();
    ListPushBack(list, 1);
    ListPushBack(list, 2);
    ListPushBack(list, 3);
    ListPopBack(list);
    ListPopFront(list);
    ListPrint(list);
    ListDestroy(list);
    list = NULL;
}

void test2() {
    ListNode* list = ListCreate();
    ListPushBack(list, 1);
    ListPopBack(list);
    // ListPopFront(list);
    ListPrint(list);
    ListDestroy(list);
    list = NULL;
}

void test3() {
    ListNode* list = ListCreate();
    ListPushBack(list, 1);
    ListPushBack(list, 2);
    ListPushBack(list, 3);
    ListPushBack(list, 4);
    ListPushBack(list, 5);
    ListNode* a = ListFind(list, 3);
    if (a) {
        ListInsert(a, 6);
    }
    ListPrint(list);
    if (a) {
        ListErase(a->_prev);
    }
    ListPrint(list);

    ListDestroy(list);
}

int main() {
    test1();
    test2();
    test3();
    return 0;
}